IF(LINUX)
	FIND_PATH(BLUETOOTH_INCLUDE_DIR bluetooth.h /usr/include/bluetooth /usr/local/include/bluetooth)
	FIND_LIBRARY(BLUETOOTH_LIBRARY NAMES bluetooth PATH /usr/lib /usr/local/lib) 
	IF(BLUETOOTH_INCLUDE_DIR AND BLUETOOTH_LIBRARY)
		SET(BLUETOOTH_FOUND TRUE)
	ENDIF(BLUETOOTH_INCLUDE_DIR AND BLUETOOTH_LIBRARY)
ENDIF(LINUX)

IF(APPLE)
	SET(BLUETOOTH_LIBRARY "-framework IOBluetooth")
	SET(BLUETOOTH_FOUND TRUE)
ENDIF(APPLE)

IF (BLUETOOTH_FOUND)
   IF (NOT Bluetooth_FIND_QUIETLY)
      MESSAGE(STATUS "Found Bluetooth: ${BLUETOOTH_LIBRARY}")
   ENDIF (NOT Bluetooth_FIND_QUIETLY)
ELSE (BLUETOOTH_FOUND)
   IF (Bluetooth_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find Bluetooth. Please install Bluetooth package")
   ENDIF (Bluetooth_FIND_REQUIRED)
ENDIF (BLUETOOTH_FOUND)
